package com.sakiko.mongodb.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * projectName: com.sakiko.mongodb.model
 *
 * @author: sakiko
 * time: 2025/10/5 5:28
 * description: user实体类
 */

@Data
//@NoArgsConstructor
@Document("user") // 指定 mongodb中的集合名字
public class User {
    @Id
    private ObjectId id;
    private String name;
    private Integer age;
    private String email;
    private Date createDate;

//    public User(ObjectId id) {
//        this.id = id;
//    }
}
